<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="include/base.jsp" %>

<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	
	<script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<style type="text/css">
		.container .row ul li .link{
			padding: 0px;
			margin: 0px;
			display: inline;
			color: #fff;
		}
		.container .row ul li .link:hover{
			text-decoration: underline;
			color: #fff;
			background-color: #0068CD;
		}
	</style>
</head>
<body class="body">
	
	<!-- top -->
	<%@ include file="include/top.jsp" %>
	
	<div class="container">
	  <div class="row">
		<div class="span3">
			<!-- left -->
			<%@ include file="include/left.jsp" %>
		</div>
		<div class="span9">
			
			

			<a href="newFile.jspx" class="btn btn-primary" style="float:right"><i class="icon-white  icon-share"></i>上传资料</a>
			<div class="clear"></div>
			
			<ul class="nav nav-pills nav-stacked" style="background-color:#0068CD;margin:10px 0px 0px 0px;padding:5px 0px;border-radius:10px 10px 0px 0px;font-size:14px;">
			   <li class="nav-header" style="font-size:14px;float:left;padding-left:20px;"><i class="icon-th"></i><a class="link" href="fileType.jspx">文件共享</a>><a class="link" href="javascript:;">${sessionScope.fileType.name}</a></li>
			   <li style="float:right;padding-right:20px;"><a href="delFileType.jspx" class="link link-black" title="删除该文件夹"><i class="icon-trash"></i></a></li>
			</ul>

			<div class="wall">
			  <c:if test="${requestScope.state==10001}">
				<div class="alert">
				  <button type="button" class="close" data-dismiss="alert">&times;</button>
				  <strong>该文件夹下有文件，不能删除</strong>
				</div>
			  </c:if>
				<table class="table table-striped">
					<thead>
						<tr>
							<th width="30px"></th>
							<th width="60%">名称</th>
							<th width="20%">大小</th>
							<th>创建人</th>
							<th></th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${requestScope.fileList}" var="file">
							<tr>
								<td>
									<img src="img/file.png"/>
								</td>
								<td><a href="downloadFile.jspx?id=${file.id}">${file.name}</a></td>
								<c:choose>
									<c:when test="${file.filesize==0}">
										<td>不足1MB</td>
									</c:when>
									<c:otherwise>
										<td>${file.filesize}MB</td>
									</c:otherwise>
								</c:choose>
								<td>${file.employee.username}</td>
								<td><a id="del" rel="${file.id}" href="delFile.jspx?id=${file.id}"><i class="icon-trash"></i></a></td>
							</tr>						
						</c:forEach>
					</tbody>
				</table>
				
				<a href="fileType.jspx">←返回</a>
			</div>
			
			
		</div>
	  </div>
	</div>
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript">
		/* $("#del").click(function(){
			if(window.confirm("确定删除吗？")){
				var id=$("del").attr("rel");
				alert(id);
				//location.href="delFile.jspx?id="+id;
			}else{
			
			}
		}); */
	</script>
</body>
</html>